package org.hsw.test;

import lombok.extern.slf4j.Slf4j;
import org.hsw.domain.strategy.service.armory.IStrategyArmory;
import org.hsw.domain.strategy.service.armory.IStrategyDispatch;
import org.hsw.infrastructure.dao.IAwardDao;
import org.hsw.infrastructure.dao.po.Award;
import org.hsw.infrastructure.redis.IRedisService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.redisson.api.RMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class ApiTest {
    @Autowired
    private IAwardDao iAwardDao;
    @Resource
    private IRedisService redisService;
    @Resource
    private IStrategyArmory strategyArmory;
    @Resource
    private IStrategyDispatch strategyDispatch;
    @Before
    public void test() {
        strategyArmory.assembleLotteryStrategy(100001L);
    }
    @Test
    public void test1() {
        log.info("抽奖结果{}",strategyDispatch.getRandomAwardId(100001L,"4000:102,103,104,105"));
    }

}
